import 'package:flutter/material.dart';

import 'const.dart';

class CjjlPage extends StatefulWidget {
  const CjjlPage({super.key});

  @override
  State<CjjlPage> createState() => _CjjlPageState();
}

class _CjjlPageState extends State<CjjlPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.symmetric(),
        child: ListView.builder(
          itemBuilder: (BuildContext context, int index) {
            return Container(
              width: double.infinity,
              height: 90,
              child: Padding(
                padding: const EdgeInsets.symmetric(horizontal: 8.0),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '账户充值',
                          style: TextStyle(fontSize: 18, color: Colors.grey),
                        ),
                        Text(
                          '+${cz[index]}元',
                          style: TextStyle(fontSize: 18, color: Colors.green),
                        ),
                      ],
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '8月18日 11:40',
                          style: TextStyle(
                            fontSize: 18,
                          ),
                        ),
                        Text(
                          '账户余额${ye[index]}元',
                          style: TextStyle(
                            fontSize: 18,
                          ),
                        ),
                      ],
                    ),
                    Divider(
                      color: Colors.grey,
                    )
                  ],
                ),
              ),
            );
          },
          itemCount: cz.length,
        ));
  }

  Container buildContainer() {
    return Container(
      width: double.infinity,
      height: 90,
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 8.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  '账户充值',
                  style: TextStyle(fontSize: 18, color: Colors.grey),
                ),
                Text(
                  '+100元',
                  style: TextStyle(fontSize: 18, color: Colors.green),
                ),
              ],
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  '8月18日 11:40',
                  style: TextStyle(
                    fontSize: 18,
                  ),
                ),
                Text(
                  '账户余额$money1',
                  style: TextStyle(
                    fontSize: 18,
                  ),
                ),
              ],
            ),
            Divider(
              color: Colors.grey,
            )
          ],
        ),
      ),
    );
  }
}
